/**
 * StarInfoNodeExploredUninhabited.java
 *
 * Roslan's Remake of MOO in 3D using Ardor3D
 * (C) 2011 Roslan Amir. All rights reserved.
 */

package com.roslan.games.moo3d.ui.hud;

import com.roslan.games.moo3d.data.Star;
import com.roslan.games.moo3d.data.Star.Environment;
import com.roslan.games.moo3d.spatial.StarNode;

/**
 * Comments...
 * 
 * @author Roslan Amir
 * @version 1.0 - Aug 9, 2011
 */
public class StarInfoNodeExploredUninhabited extends StarInfoNodeExploredBase {

	/**
	 * Constructor.
	 * 
	 */
	public StarInfoNodeExploredUninhabited() {
		super("ExploredUninhabited");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.roslan.games.moo3d.ui.hud.StarInfoNodeBase#update(com.roslan.games.moo3d.spatial.StarNode)
	 */
	@Override
	protected void update(StarNode starNode) {
		super.update(starNode);

		Star star = starNode.getStar();
		sb.append('\n');
		sb.append(((star.environment == Environment.NONE) ? "<<NO HABITABLE PLANETS>>" : "<<NO COLONIES>>"));
		sb.append("\nRange: " + starNode.range + " parsecs");
		text.setText(sb.toString());

		if (!starNode.hasChild(this)) {
			starNode.attachChild(this);
		}
	}

}
